#ifndef _VWORDLIST_H
#define _VWORDLIST_H

#include "wordlist.h"
#include "CPstring.h"
#include "vector.h"

// concrete WordList class implemented using sorted vectors
// Michael Loeb and Owen Astrachan
// 2/7/97
// operations
//
// const string * AddWord(const string & word)
//       -- Adds word to dictionary, return pointer to word
//          complexity: O(n) for an n word list
//
// const string * FindWord(const string & word)
//       -- returns pointer to word in dictionary
//          return 0 if word not in dictionary
//          complexity: O(log n) for an n word list


class VWordList : public WordList
{
  public:
    VWordList(int count=1);  // constructor
    ~VWordList();            // destructor

    // implement inherited functions
    
    virtual 
      const string * AddWord(const string & word);  
    virtual
      const string * FindWord(const string & word) const;
    virtual
      void Print(ostream & os) const;
    
  private:
    Vector<const string *> myList;  // list of words
    int myCount;                    // # of entries in list	   

	   
};

#endif

